package attendance

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type StudentRouter struct {
}

// InitStudentRouter 初始化 学生表 路由信息
func (s *StudentRouter) InitStudentRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	stuRouter := Router.Group("stu").Use(middleware.OperationRecord())
	stuRouterWithoutRecord := Router.Group("stu")
	stuRouterWithoutAuth := PublicRouter.Group("stu")

	var stuApi = v1.ApiGroupApp.AttendanceApiGroup.StudentApi
	{
		stuRouter.GET("templateExport", stuApi.TemplateExport)
		stuRouter.POST("createStudentUpload", stuApi.CreateStudentUpload)
		stuRouter.POST("createStudent", stuApi.CreateStudent)             // 新建学生表
		stuRouter.DELETE("deleteStudent", stuApi.DeleteStudent)           // 删除学生表
		stuRouter.DELETE("deleteStudentByIds", stuApi.DeleteStudentByIds) // 批量删除学生表
		stuRouter.PUT("updateStudent", stuApi.UpdateStudent)              // 更新学生表
	}
	{
		stuRouterWithoutRecord.GET("findStudent", stuApi.FindStudent)       // 根据ID获取学生表
		stuRouterWithoutRecord.GET("getStudentList", stuApi.GetStudentList) // 获取学生表列表
	}
	{
		stuRouterWithoutAuth.GET("getStudentPublic", stuApi.GetStudentPublic) // 获取学生表列表
	}
}
